import requests


class Test_login:
    def login_test(self, name, pwd):
        sess = requests.Session()
        sess.get(url='http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.26176440464473283')

        url = 'http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login&t=0.05227439093039876'

        resp = sess.post(url=url, headers={"Content-Type": "application/x-www-form-urlencoded"},
                         data={"username": name, "password": pwd, "verify_code": "8888"})

        return resp
